﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sms_Send_log_ViewSended.aspx.cs" Inherits="JKF.Web.SMS.Sms_Send_log_ViewSended" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%= RegScript("~/js/jquery.1.5.js")%>
    <%= RegScript("~/js/jquery.nhis.js")%>
    <%= RegScript("~/js/jquery.rchis.js")%>
    <%= RegScript("~/js/jquery-ui-custom.min.js")%>
    <%=RegScript("~/js/jquery.json.js")%>
    <%= RegScript("~/js/css.js")%>
    <%= RegScript("~/js/DatePicker/WdatePicker.js")%>
    <%= RegScript("~/js/Common.js")%>
    <%= RegScript("~/js/Jquery.commonGrid.js")%>
    <%=this.RegStyle("~/App_Themes/Theme2/Include.css")%>
    <script type="text/javascript">
        var AppPath = '<%=AppPath %>';
        var handler = AppPath + '/do/SMS/SmsModule.do';
        var tmpl = new DTemplate();
        var PageSize = 20;
        var pager = null;
        var shops = <%=Shops%>;
        var advSearch = null;
        var rowTemplate = "<tr pk=\"${CUSTOMER_KEY}\"><td>${CARD_NO}</td><td>${CUSTOMER_NAME}</td><td>${MOBILE}</td><td>${CONTENT}</td><td>${CONSUME_NUM}</td><td>${OPERATOR}</td><td>${DATE_SEND}</td><td>${JUST_TIME_NAME}</td><td>${STATUS_NAME}</td><td>${REASON_FAILURE}</td></tr>";
        $(function () {
            pager = $('#divPager').pager(AppPath, handler, function () {
                return {
                    ActionName: 'GetSmsSended',
                    srchOptions: $.toJSON({
                        DateSendFrom: $.trim($("#DateSendFrom").val()),
                        DateSendTo: $.trim($("#DateSendTo").val()),
                        SendShop: $.FxNull($("#ownShop").attr("codes"), ""),
                        SendState: $.trim($("#SendState").val()),
                        Field: $.trim($("#Field").val()),
                        FieldValue: $.trim($("#FieldValue").val()),
                        SendNow: $.trim($("#SendNow").val())
                    })
                };
            }, function (data) {
                var tbody = $('#tb tbody');
                tbody.empty();
                if (data && data.Entity && data.Entity.length) {
                    tbody.html(tmpl(rowTemplate, data.Entity, true));
                } else {
                    tbody.html('<tr><td colspan="10" style="text-align: center">没有数据!</td></tr>');
                }
                $("#tb").H8_Grid($("#divPager"), (function (){var tbHeight = $(window).height()-35; tbHeight-=($(".common_search").size()>0)?$(".common_search").eq(0).height():0; tbHeight-=($("#divPager").size()>0)?$("#divPager").height():0; return tbHeight < 300 ? 300 : tbHeight;})());
            }, PageSize, true);

            $('#btnSearch').click(function () {
                advSearch = null;
                pager.option.pageIndex = 1;
                pager.getPegerData();
                return false;
            });
            $("#ownShop").MgrShopSelect(AppPath, shops);
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="warrper_body">
            <div class="index">
                <div class="common_search">
                    <div class="l_h45">
                        <span class="mr30 mb20" style=" margin-left: 14px; text-align: right;">查询项：
                        <select id="Field" class="common_search_select w150">
                            <option value="">请选择</option>
                            <option value="CARD_NO">卡号</option>
                            <option value="CUSTOMER_NAME">姓名</option>
                            <option value="MOBILE">手机</option>
                        </select>
                            <input type="text" id="FieldValue" class="common_search_input w150" />
                        </span>
                        <span class="mr30 mb20">发送店铺：
                        <input type="button" id="ownShop" class="common_btn_gaoji115" />
                        </span>
                        <span class="mr30 mb20">发送时间：
                        <input type="text" id="DateSendFrom" onfocus="WdatePicker()" class="common_search_input w100" />
                            至
                            <input type="text" id="DateSendTo" onfocus="WdatePicker()" class="common_search_input w100" />
                        </span>

                    </div>
                    <div class="l_h45">
                        <span class="mr30 mb20">发送状态：
                        <select id="SendState" class="common_search_select w150">
                            <option value="">请选择</option>
                            <option value="0">未发送</option>
                            <option value="2">发送成功</option>
                            <option value="3">发送失败</option>
                        </select>
                        </span>
                        <span class="mr30 mb20">即时发送：
                        <select id="SendNow" class="common_search_select w150">
                            <option value="">请选择</option>
                            <option value="0">即时发送</option>
                            <option value="1">定时发送</option>
                        </select>
                        </span>
                        <input id="btnSearch" type="button" value="" class="common_btn_search" />
                    </div>
                </div>
                <div class="l_h7"></div>
                <div class="index_table">
                    <table id="tb" class="common_table">
                        <thead>
                            <tr>
                                <th width="90px" orderaction="false">卡号
                                </th>
                                <th width="100px" ordertype="string">姓名
                                </th>
                                <th width="100px" ordertype="string">发送号码
                                </th>
                                <th width="250px" ordertype="string">短信内容
                                </th>
                                <th width="100px" ordertype="string">消耗条数
                                </th>
                                <th width="100px" ordertype="string">发送人
                                </th>
                                <th width="100px" ordertype="string">发送时间
                                </th>
                                <th width="80px" ordertype="string">即时/定时
                                </th>
                                <th width="100px" ordertype="string">发送状态
                                </th>
                                <th width="150px" ordertype="string">发送失败原因
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="8" style="text-align: center">点击搜索查看数据
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="page" id="divPager">
                </div>
            </div>
        </div>
    </form>
</body>
</html>
